import request from "@/utils/request";

// 查询试卷列表
export function listJuanPaper(query) {
  return request({
    url: "/juan/juanPaper/list",
    method: "get",
    params: query,
  });
}

// 查询试卷详细
export function getJuanPaper(paperId) {
  return request({
    url: "/juan/juanPaper/" + paperId,
    method: "get",
  });
}

// 新增试卷
export function addJuanPaper(data) {
  return request({
    url: "/juan/juanPaper",
    method: "post",
    data: data,
  });
}

// 修改试卷
export function updateJuanPaper(data) {
  return request({
    url: "/juan/juanPaper",
    method: "put",
    data: data,
  });
}

// 删除试卷
export function delJuanPaper(paperId) {
  return request({
    url: "/juan/juanPaper/" + paperId,
    method: "delete",
  });
}

// 查询试卷数据分析
export function getJuanPaperStatistics(paperId) {
  return request({
    url: "/juan/juanPaper/queryPaperStatisticsById/" + paperId,
    method: "get",
  });
}

// 随机抽卷
export function randomJuanPaper(data) {
  return request({
    url: "/juan/juanPaper/randomTakeOutPaper",
    method: "post",
    data: data,
  });
}

// 试卷历史留存
export function saveJuanPaperBakeup(paperId) {
  return request({
    url: "/juan/juanPaperBakeup/insertByPaperId/" + paperId,
    method: "get",
  });
}

// 试卷历史列表
export function queryBakeupList(query) {
  return request({
    url: "/juan/juanPaperBakeup/queryBakeupList",
    method: "get",
    params: query,
  });
}

// 查询试卷历史详细
export function getJuanPaperBakeup(paperId) {
  return request({
    url: "/juan/juanPaperBakeup/queryBakeupById/" + paperId,
    method: "get",
  });
}

// 删除试卷历史
export function deljuanPaperBakeup(paperId) {
  return request({
    url: "/juan/juanPaperBakeup/deleteById/" + paperId,
    method: "delete",
  });
}

// 查询试卷历史数据分析
export function getBakeupStatistics(paperId) {
  return request({
    url: "/juan/juanPaperBakeup/queryPaperStatisticsById/" + paperId,
    method: "get",
  });
}

// 待抽取试卷列表
export function queryUnBeenTakenOutBakeupList(query) {
  return request({
    url: "/juan/juanPaperBakeup/queryUnBeenTakenOutBakeupList",
    method: "get",
    params: query,
  });
}

// 已抽取试卷列表
export function queryBeenTakenOutBakeupList(query) {
  return request({
    url: "/juan/juanPaperBakeup/queryBeenTakenOutBakeupList",
    method: "get",
    params: query,
  });
}

// 已抽取试卷列表
export function randomTakeOutPaper(data) {
  return request({
    url: "/juan/juanPaperBakeup/randomTakeOutPaper",
    method: "post",
    data: data,
  });
}
